/*********************************************************************
 * Author: Benzi K. Ahamed
 *         www.benzi-ahamed.blogspot.com 
 * Date:   August 01 2007
 * 
 * Part of the Citrus framework
 * Copyright (C) 2007 - All rights reserved 
 * ********************************************************************/

using System;

namespace Common.Util
{
    public enum DataType
    {
        String,
        DateTime
    }

    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
    public class ImportFieldAttribute : Attribute
    {
        #region Properties and fields
        /// <summary>
        /// The position of the field
        /// </summary>
        private int _position;

        public int Position
        {
            get { return _position; }
            set { _position = value; }
        }

        private string _validationPattern;
        /// <summary>
        /// The regexp validation pattern for the field
        /// Validation happens only if EnableValidation is set to true
        /// </summary>
        public string ValidationPattern
        {
            get { return _validationPattern; }
            set { _validationPattern = value; }
        }

        private bool _enableValidation;
        /// <summary>
        /// Set to true if validation is required
        /// </summary>
        public bool EnableValidation
        {
            get { return _enableValidation; }
            set { _enableValidation = value; }
        }

        private bool _enableTrimming;
        /// <summary>
        /// Determines whether input should be trimmed
        /// </summary>
        public bool EnableTrimming
        {
            get { return _enableTrimming; }
            set { _enableTrimming = value; }
        }

        private DataType _dataType;
        /// <summary>
        /// The type of data for the field
        /// </summary>
        public DataType DataType
        {
            get { return _dataType; }
            set { _dataType = value; }
        }
        

        #endregion

        #region Ctor
        public ImportFieldAttribute(int position)
        {
            this._position = position;
            this.DataType = DataType.String;
        }
        #endregion
    }
}
